package cn.itcast.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("hello")
public class HelloController {

	@GetMapping("show")
	@ResponseBody
	public String test(){
		
		return "這是第一個springboot程序！";
	}
	
	@GetMapping("ssss")
	public String toHello(Model model){
		model.addAttribute("msg", "这是springboot的web程序！");
		
		return "hello";
	}
}
